package sk.naive.talker;

import sk.naive.talker.adapter.*;
import sk.naive.talker.command.CommandCallback;
import sk.naive.talker.callback.CallbackException;
import sk.naive.talker.message.Message;
import sk.naive.talker.persistence.*;

import java.rmi.RemoteException;
import java.util.*;

/**
 * Kernel side of the user interface (user proxy interface).
 *
 * @author <a href="mailto:virgo@naive.deepblue.sk">Richard "Virgo" Richter</a>
 * @version $Revision: 1.61 $ $Date: 2005/02/08 21:39:22 $
 */
public interface User extends PersistentObject {
	String UPROP_ID = "id";
	String UPROP_LOGIN = "login";
	String UPROP_PASSWORD = "password";
	String UPROP_LANG = "lang";
	String UPROP_MYCOLOUR = "mycolour";
	String UPROP_NAME = "name";
	String UPROP_AUTH_METHOD = "authMethod";
	String UPROP_CREATED = "created";
	String UPROP_PLAIN_PASSWORD = "plainPassword";
	String UPROP_LAST_ACTION_TIME = "lastActionTime";
	String UPROP_LAST_LOGIN = "lastLogin";
	String UPROP_LOGIN_TIME = "loginTime";
	String UPROP_LAST_SESSION_TIME = "lastSessionTime";
	String UPROP_LAST_TLT_SAVE = "lastTltSave";
	String UPROP_LAST_LOCATION = "lastLocation";
	String UPROP_SAVE_LAST_LOCATION = "saveLastLocation";
	String UPROP_MACROS = "macros";
	String UPROP_MACRO_GLOBALS = "macroGlobals";
	String UPROP_MACRO_USERS = "macroUsers";
	String UPROP_MACRO_SPACES_DELIM = "macroSpacesDelim";
	String UPROP_CORRECTIONS = "corrections";
	String UPROP_CORRECTIONS_ENABLED = "correctionEnabled";
	String UPROP_DEFAULT_COMMAND = "defaultCommand";
	String UPROP_COMMAND_SIGN = "commandSign";
	String UPROP_HIGHLIGHT_ADDRESSED_MESSAGE = "highlightAddressedMessage";
	String UPROP_TOTAL_LOGIN_TIME = "totalLoginTime";
	String UPROP_TOTAL_IDLE_TIME = "totalIdleTime";
	String UPROP_TOTAL_AFK_TIME = "totalAfkTime";

	String AUTH_METHOD_NEW = "new";

	void send(Message m) throws RemoteException;
	void send(String s) throws RemoteException;

	Integer getId();
	String getLogin();
	String getLang();

	AdapterProxy getAdapter();
	AdapterUser getRemoteUser();

	String setupCommandCallback(CommandCallback callback) throws CallbackException;
	CommandCallback useCommandCallback(String cId);

	Set<String> getSettable();

	boolean isOnline();
}
